package com.jz.netthings.bloodsources.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.jz.netthings.bloodsources.bean.XyLink;
import com.jz.netthings.exception.AdscmSystemException;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 血源链接表
----表关系↓
--- 血源公告牌鉴权表
             |
---血源链接表
          ---提醒记录表
          ---未献浆记录表
          ---回访记录表
 
 Mapper 接口
 * </p>
 *
 * @author 张凡
 * @since 2019-08-03
 */
public interface XyLinkMapper extends BaseMapper<XyLink> {
  public List<XyLink> queryByCondition(
                                       @Param("useNurseDeptId") String useNurseDeptId,
                                       @Param("useNurseId") Integer useNurseId,
                                       @Param("providerAddress") String providerAddress,
                                       @Param("nurseName")String nurseName,
                                       @Param("linkProviderId")String linkProviderId,
                                       @Param("providerName")String providerName,
                                       @Param("providerActiveLevel")String providerActiveLevel,
                                       @Param("useVolunteer")String useVolunteer,
                                       @Param("isPulpingMsg")String isPulpingMsg,
                                       @Param("currentPage")int currentPage,
                                       @Param("pageSize")int pageSize
                                        );
  public List<XyLink> loadXyLinkToCache(@Param("pulpingMsgType") String pulpingMsgType);
  public Integer queryByCount(
                              @Param("useNurseDeptId") String useNurseDeptId,
                              @Param("useNurseId") Integer useNurseId,
                              @Param("providerAddress") String providerAddress,
                              @Param("nurseName")String nurseName,
                              @Param("providerName")String providerName,
                              @Param("providerActiveLevel")String providerActiveLevel,
                              @Param("useVolunteer")String useVolunteer);
    public Boolean updateByProviderId(@Param("xyLink")XyLink xyLink) throws AdscmSystemException;

    /**
     * 查看所有链接护士及护士链接浆员数量
     * @return
     */
    List<Map<String, Object>> getLinkNursePCount();

    /**
     * 查看某个护士链接的所有浆员的ID集合
     * @return
     */
    List<Long> getLinkNursePList(@Param("useNurseId") Integer useNurseId);

}
